﻿@addTagHelper *, WebVella.Erp.Plugins.Core
@addTagHelper *, WebVella.Erp.Web
@addTagHelper *, WebVella.TagHelpers
@using WebVella.Erp.Web.Utils;
@using WebVella.Erp.Api.Models;
@using WebVella.Erp.Web;
@using WebVella.Erp.Web.Models;
@using WebVella.TagHelpers.Models;
@using WebVella.Erp.Web.Components;
@{
	var options = (PcChart.PcChartOptions)ViewBag.Options;
	var node = (PageBodyNode)ViewBag.Node;
	var erpRequest = (ErpRequestContext)ViewBag.RequestContext;
	var typeOptions = (List<WvSelectOption>)ViewBag.ChartTypeOptions;
}

<wv-row>
	<wv-column span="4">
		<wv-field-datasource name="is_visible" label-text="Is Rendered" value="@options.IsVisible" page-id="erpRequest.Page.Id" placeholder="true"></wv-field-datasource>
	</wv-column>
</wv-row>
<wv-row>
	<wv-column span="4">
		<wv-field-datasource name="datasets" value="@options.Datasets" label-text="Datasets" 
			page-id="erpRequest.Page.Id" 
			description="Supported data types: List&lt;ErpChartDataset>, List&lt;decimal>, CSV(decimal)"></wv-field-datasource>
	</wv-column>
	<wv-column span="4">
		<wv-field-datasource name="labels" value="@options.Labels" label-text="Labels" page-id="erpRequest.Page.Id"
			description="Supported data types: List&lt;string> or CSV"></wv-field-datasource>
	</wv-column>
	<wv-column span="4">
		<wv-field-select name="type" value="@options.Type" label-text="Chart type" options="typeOptions" required="true"></wv-field-select>
	</wv-column>
</wv-row>
<wv-row>
	<wv-column span="4">
		<wv-field-text name="width" value="@options.Width" label-text="Width style value"></wv-field-text>
	</wv-column>
	<wv-column span="4">
		<wv-field-text name="height" value="@options.Height" label-text="Height style value"></wv-field-text>
	</wv-column>
	<wv-column span="4">
		<wv-field-checkbox name="show_legend" value="@options.ShowLegend" label-text="Show Legend"></wv-field-checkbox>
	</wv-column>
</wv-row>
